<template>
  <div>
    {{data.userId}}
    <hr />
  </div>
</template>

<script setup>
const data = {userId: 10}

const storedData = {}
storedData.userId = data.userId
Object.defineProperty(data, 'userId',{
  get() {
    return storedData.userId
  },
  set(value) {
    console.log('user ID changed !')
    storedData.userId = value
  },
  configurable: true,
  enumerable: true
})
</script>

<style scoped>

</style>